<?php

namespace app\user\controller;

use app\common\respond\HttpApi;
use app\user\logic\IndexLogic;

class IndexController
{
    /**
     * @Description 首页统计
     * @author: zj
     * @param HttpApi $respond
     * @time 2024/03/20 16:32:30
     * @return \think\response\Json
     */
    public function statistic(HttpApi $respond)
    {
        $param = [
            'barn_id' => request()->get('barn_id') ?: 0,
        ];
        $rule = [
            'barn_id' => 'integer|>=:0'
        ];
        validate($rule)->check($param);

        $logic = new IndexLogic();
        $data = $logic->statistic($param);

        return $respond->success($data);
    }

}